package com.springboot.demo.config;

import com.springboot.demo.config.zookeeper.ZookeeperConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

/**
 * 项目配置值
 *
 * @author supu
 * @date 2019-08-26 14:58
 **/
@Configuration
public class DemoConfigService {
    @Autowired
    private ZookeeperConfigService zookeeperConfigService;

    /**
     * mongo 配置
     */
    public static final String MONGO_USER_NAME = "mongo.user.name";
    public static final String MONGO_PASSWORD = "mongo.password";
    public static final String MONGO_DATABASE_NAME = "mongo.database.name";
    public static final String MONGO_HOST_LIST = "mongo.host.list";

    /**
     * 根据key获取value
     *
     * @param key
     * @return
     */
    public String getValueByKey(String key) {
        return zookeeperConfigService.getValue(key);
    }
}
